import services.interfaces.BillingServiceAdapter;
import services.interfaces.CityTaxAdapter;
import services.interfaces.CountyTaxAdapter;
import services.interfaces.ServicesFactory;
import use_case.processRental.Sale;
import junit.framework.TestCase;


public class ServicesFactoryTest extends TestCase {
	private ServicesFactory service;
	
	protected void setUp(){
		service = ServicesFactory.getInstance();
	}
	
	protected void tearDown(){
		service = null;
	}
	
	public void testGetTaxCalculatorAdapterForCountyTax(){
		setUp();
		assertTrue(service.getTaxCalculatorAdapter("County") instanceof CountyTaxAdapter);
		tearDown();
	}

	public void testGetTaxCalculatorAdapterForCityTax(){
		setUp();
		assertTrue(service.getTaxCalculatorAdapter("City") instanceof CityTaxAdapter);
		tearDown();
	}
	
	public void testGetTaxCalculatorAdapterForNull(){
		setUp();
		assertTrue(service.getTaxCalculatorAdapter("Rubbish") == null);
		tearDown();
	}
	
	public void testGetBillingServiceAdapter(){
		setUp();
		assertTrue(service.getBillingServiceAdapter() instanceof BillingServiceAdapter);
		tearDown();
	}
}
